#pragma once 

#include<iostream>
#include<string>
#include<vector>

using namespace std;

class Util
{
public:
    static bool StringSplit(const string &str,const string &sep,vector<string>*result)
    {
        size_t start=0;
        while(start<str.size())
        {
            auto pos=str.find(sep,start);
            if(pos==string::npos)
                break;
            result->push_back(str.substr(start,pos-start));
            start=pos+sep.size();
        }
        //处理最后一个字符
        if(start<str.size()) result->push_back(str.substr(start));

        return true;
    }

    static int toInt(std::string&str)
    {
        return atoi(str.c_str());
    }
};